package com.future.mayi.utils;

import android.content.Context;
import android.content.Intent;

import com.future.mayi.activity.GoodsListActivity;
import com.future.mayi.activity.MainActivity;
import com.future.mayi.activity.MyRedPacketActivity;
import com.future.mayi.qsale.activity.ConsignSaleActivity;
import com.future.mayi.qsale.activity.FlowIntroActivity;
import com.future.mayi.qsale.activity.ProtocolActivity;
import com.future.mayi.qsale.activity.QuickSaleActivity;
import com.future.mayi.qsale.activity.RedPackRulrActivity;
import com.future.mayi.qsale.activity.SucceedConsignActivity;

/**
 * Created by Administrator on 2018/5/24.
 */

public class Navigator {


    public static void navigatorGetLuxury(Context mContext) {
        Intent intent = new Intent(mContext, MainActivity.class);
        intent.putExtra("intentToIndexFragment", true);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        mContext.startActivity(intent);
    }

    public static void navigarorRedPacketRuleActivity(Context context) {
        context.startActivity(createSimpleIntent(context, RedPackRulrActivity.class));
    }

    public static void navigatorMyRedPacketActivity(Context context) {
        context.startActivity(createSimpleIntent(context, MyRedPacketActivity.class));
    }

    public static void navigatorFlowIntroActivity(Context context, boolean isRecycler) {
        Intent intent = new Intent(context, FlowIntroActivity.class);
        intent.putExtra(FlowIntroActivity.EXTRA_IS_RECYCLER, isRecycler);
        context.startActivity(intent);
    }

    public static void navigatorProtocolActivity(Context context, boolean isRecycler) {
        Intent intent = new Intent(context, ProtocolActivity.class);
        intent.putExtra(ProtocolActivity.EXTRA_IS_RECYCLER, isRecycler);
        context.startActivity(intent);
    }

    //orderType 1是寄卖 2是回收
    public static void navigatorToSucceedConsignActivity(Context context, String orderId, int orderType) {
        Intent intent = new Intent(context, SucceedConsignActivity.class);
        intent.putExtra(SucceedConsignActivity.EXTRA_ORDER_ID, orderId);
        intent.putExtra(SucceedConsignActivity.EXTRA_ORDER_TYPE, orderType);
        context.startActivity(intent);
    }

    public static void navigatorToRecycleActivity(Context context) {
        Intent intent = new Intent(context, ConsignSaleActivity.class);
        intent.putExtra(ConsignSaleActivity.EXTRA_IS_SALE, false);
        context.startActivity(intent);
    }

    public static void navigatorToConsignSaleActivity(Context context) {
        Intent intent = new Intent(context, ConsignSaleActivity.class);
        intent.putExtra(ConsignSaleActivity.EXTRA_IS_SALE, true);
        context.startActivity(intent);
    }

    public static void navigatorToQuickSaleActivity(Context context) {
        context.startActivity(createSimpleIntent(context, QuickSaleActivity.class));
    }

    public static Intent createSimpleIntent(Context context, Class<?> cls) {
        return new Intent(context, cls);
    }


}
